import Highcharts from "highcharts";

/**
 * 折线图柱状混合图
 * @param id id名称
 * @param categories  x轴数据
 * @param series Y轴数组数据
 */
export const chartColumnFoldLine = (id, categories, series) => {
    var chart = Highcharts.chart(id, {
        chart: {
            // zoomType: 'xy',
            animation: false,
            panning: false, // 禁止放大
            pinchType: false, // 禁用手势操作
            style: {
                fontSize: '12px',
            }
        },
        colors:['#FF4737','#E7C694'],
        credits: {enabled: false},
        accessibility: {
            enabled: false
        },
        title: {
            text: ''
        },
        xAxis: [{
            categories: categories,
            crosshair: true,
            lineColor: '#F3F4F5',
            labels: {
                y:20,
                style: {
                    fontSize: "12px",
                    color: 'rgba(165, 166, 173, 1)',
                }
            }
        }],
        yAxis: [
            { // Secondary yAxis
                labels: {
                    format: '{value} %',
                    style: {
                        fontSize: "12px",
                        color: 'rgba(165, 166, 173, 1)',
                    }
                },
                title: {
                    text: '',
                },

                opposite: true
            },
            { // Primary yAxis
                labels: {
                    style: {
                        fontSize: "12px",
                        color: 'rgba(165, 166, 173, 1)',
                    }
                },
                title: {
                    align: 'low',
                    offset: 0,
                    text: '(万元)',
                    rotation: 0,
                    y: 20,
                    x:-30,
                    style: {
                        fontSize: "12px",
                        color: 'rgba(165, 166, 173, 1)',
                    }
                },
            },
        ],
        tooltip: {
            shared: true
        },
        legend: {
            verticalAlign: 'top',
        },
        series:series
    });
}